package com.example.demo.web.api

import com.example.demo.data.Taco
import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport

class TacoResourceAssembler : RepresentationModelAssemblerSupport<Taco, TacoResource>(Taco::class.java, TacoResource::class.java) {

    override fun instantiateModel(entity: Taco): TacoResource {
        return TacoResource(entity)
    }

    override fun toModel(entity: Taco): TacoResource {
        return createModelWithId(entity.id, entity, "taco", "zhangsan")
    }
}